package com.telecom.cms.service;

import java.util.List;
import com.telecom.cms.dao.SysDepartDAO;
import com.telecom.cms.dao.SysUserDAO;
import com.telecom.cms.dto.SysDepart;
import com.telecom.cms.util.Constant;

public class SysDepartMgr {
   
	public void save(SysDepart sysdepart){
		(new SysDepartDAO()).insert(sysdepart); 
	}
	
	public void  delete(SysDepart sysdepart){
		(new SysDepartDAO()).delete(sysdepart);
	}
	
	public List findall(){
		List result=(new SysDepartDAO()).findAll();
		return result;
	}
	
	public List findall(String latnid){
		if (latnid.equals((new Constant()).getPara("PROVINCEID")))
			return findall();
		List result=(new SysDepartDAO()).findAll(latnid);
		return result;
	}
	
	public SysDepart findbyid(String myid){
		SysDepart result=(new SysDepartDAO()).findById(Integer.parseInt(myid));
		return result;
	}
	
}
